﻿using System;
using System.Collections.Generic;
using IntegratedMeasuring.Utils;
using Newtonsoft.Json;
using SqlSugar;

namespace IntegratedMeasuring.ViewModels.Scheme;

public class TestConditions
{
    [SugarColumn(IsPrimaryKey = true)]
    public long Id { get; set; }

    // 机种名称
    public string Name { get; set; }  
    
    // 机种描述
    [SugarColumn(IsNullable = true)]
    public string Remarks { get; set; }
    
    // 测试文件Blob
    public byte[] SourceData { get; set; }
    
    // 测试文件可视化数据
    [SugarColumn(IsIgnore = true)]
    public List<TransItemData> BeautifyData { get; set;}

    [SugarColumn(IsIgnore = true)]
    // [ObservableProperty]
    public bool? IsSelected { get; set; } = false;
    
    [JsonConverter(typeof(CustomDateTimeConverter))]
    public DateTime CreateTime { get; set; }
    
    [SugarColumn(IsNullable = true)]
    public int ApplicableInstrument { get; set; }
    
    [SugarColumn(IsNullable = true)] public bool IsSynch { get; set; } = false;
}

public class TransItemData : TestRecord
{
    public int Pri { get; set; }
    public int Sec { get; set; }
    public string? MinorTerm { get; set; }
    public string? Pins { get; set; }
    public string? ParallelPin { get; set; }
    public string? SeriesPin { get; set; }
    public string? ShortCircuitPin { get; set; }
    public string? Nominal { get; set; } // 标称
    public string? LowerLimit { get; set; }
    public string? UpperLimit { get; set; }
    public string? Freq { get; set; }
    public string Vol { get; set; }
    
}